package com.yan.domain;

public class Goods {
    private String id;
    private String name;
    private int num;
    private double peice;
    private String state;

    public Goods(String id, String name, int num, double peice, String state) {
        this.id = id;
        this.name = name;
        this.num = num;
        this.peice = peice;
        this.state = state;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getpeice() {
        return peice;
    }

    public void setpeice(double peice) {
        this.peice = peice;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public void calculatePrice(int num , double price){
        double money = num *  price;
        System.out.println("商品价格为:" + money);
        upDate(num);
    }

    public void upDate(int num){
        this.num = this.num - num;
        System.out.println("修改库存量为:" + this.num);
    }

}
